<!--
  Generated template for the HomePage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar>
    <ion-title>首页</ion-title>
  </ion-navbar>

</ion-header>


<ion-content id="home">
  <!--<div class="slide-container">
    <ion-slides autoplay="700">
      <ion-slide *ngFor="let idiotpmg of data">
        <a *ngIf='idiotpmg.adsense_type == 1 && Internet==1' href="{{idiotpmg.urls}}"><img src="{{idiotpmg.img}}" alt="" /></a>
        <a *ngIf='Internet==0'><img src="./assets/imgs/offline.jpg"></a>

        <video *ngIf='idiotpmg.adsense_type == 0 && Internet==1' width="180" height="180" autoplay="autoplay" loop>
          <source src="{{idiotpmg.img}}" type="video/mp4">
        </video>

      </ion-slide>

    </ion-slides>
  </div>-->
  
<div class="index">
	<!-- 轮播 -->
	<header>
		<a *ngIf='Internet==0'><img src="./assets/imgs/offline.jpg" style="height: 160px;width: 100%;"></a>
		<div  *ngIf='Internet==1' class="swiper-container">
			<div class="swiper-wrapper">
				<div class="swiper-slide" *ngFor="let idiotpmg of data">
					<a *ngIf='idiotpmg.adsense_type == 1 && Internet==1' href="javacript:;" (click)="openLink(idiotpmg.urls)"><img src="{{idiotpmg.img}}" alt="" /></a>
					<!--<a *ngIf='Internet==0'><img src="./assets/imgs/offline.jpg"></a>-->
					<!--<img src="{{idiotpmg.img}}"  title="宣传图片">-->
					<!--<img src="../../assets/imgs/1.jpg" alt="图片加载失败" title="宣传图片">-->
						
					<video *ngIf='idiotpmg.adsense_type == 0 && Internet==1' width="180" height="180" autoplay="autoplay" loop>
	          <source src="{{idiotpmg.img}}" type="video/mp4">
	        </video>
				</div>
			</div>
			<div class="swiper-button-next"></div>
			<div class="swiper-button-prev"></div>
		</div>
	</header>
</div>

  <div class="D-module-wrap">
    <div class="D-module">
      <div class="D-module-part Charge" (click)="skipToChargingBattery()">
        <div class="D-icon">
          <img src="assets/imgs/charging-battery.png" alt="" class="D-image" />
        </div>
        <div class="D-icon-text">
          <span class="charging-battery">充电</span>
        </div>
      </div>
      <div class="D-module-part Recharge" (click)="skipToChargingAccountPage()">
        <div class="D-icon">
          <img src="assets/imgs/charging-account.png" alt="" class="D-image" />
        </div>
        <div class="D-icon-text">
          <span class="charging-account">充值</span>
        </div>
      </div>
    </div>
  </div>


  <ion-list class="D-information-list">
    <ion-list-header class="information">
      资讯
    </ion-list-header>
    <!--把data2的内容进行遍历，定义对象，然后对象.属性名-->

    <ion-item *ngFor="let idiotpmg of information" (click)="skipToNewsDetail(idiotpmg)">
      <ion-thumbnail item-end>
        <!--<img src="../../assets/imgs/message1.jpg">-->
        <a *ngIf='Internet==1'><img src="{{idiotpmg.img2}}"></a>
        <a *ngIf='Internet==0'><img src="./assets/imgs/offline2.jpg"></a>
      </ion-thumbnail>
      <h2 class="headline">{{idiotpmg.titles}}</h2>
      <p>{{idiotpmg.date | date:"yyyy/MM/dd"}}</p>
    </ion-item>
    <ion-thumbnail *ngIf="nodata === 1">
      <p class="font-home">没有更多了~</p>
    </ion-thumbnail>

    <ion-thumbnail *ngIf="nodata !== 1" (click)="lodeMessage($event,'text')">
      <p class="font-home">下拉加载</p>
    </ion-thumbnail>

  </ion-list>
  <!-- <ion-infinite-scroll (ionInfinite)="load()" distance="1%" ></ion-infinite-scroll> -->

  <ion-infinite-scroll *ngIf="nodata !== 1" (ionInfinite)="lodeMessage($event,'scroll')">
    <ion-infinite-scroll-content></ion-infinite-scroll-content>
  </ion-infinite-scroll>
</ion-content>